// npm install superagent
// npm install superagent-proxy
let request = require('superagent')
require('superagent-proxy')(request)

let targetUrl = 'http://myip.ipip.net'

let proxyServer = 'proxy.ipipgo.com:31212'
// let proxyUrl = 'http://' + proxyServer
//账号密码验证
let proxyUrl = 'http://' + 'customer-497bde:18c98c36' + '@' + proxyServer

request.get(targetUrl)
    .proxy("http://customer-497bde:18c98c36@proxy.ipipgo.com:31212")
    .then(res => {
        console.log(res.text)
    }).catch(err => {
        console.log(err.message)
    })